﻿@model IEnumerable<Gfw.Models.Admin.UsrDepartment>
@using C.Mvc;
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml"; 
}
@section Scripts {
    @System.Web.Optimization.Scripts.Render("~/script/tree")
    @System.Web.Optimization.Styles.Render("~/css/tree")
    @*@System.Web.Optimization.Scripts.Render("~/bundles/jqueryval")*@
    @System.Web.Optimization.Styles.Render("~/bundles/datapage")
    <script type="text/javascript">

        $(document).ready(function () {
            $("#tree").treeview();
        });
    </script>
}
<div class="contentpanel" style="width: 300px; float: left">
    <div class="title">
        部门列表
    </div>
    <div id="line_between">
        <img src="~/Content/Site/images/line_between.png" width="100%" height="2" /></div>
    <div class="content">
        <div>
            @Html.ActionLink("添加顶级部门", "CreateRoot")
        </div>
        <div>
            @{
     
                @(Html.TreeView(Model)
            .EmptyContent("该部门下没有人员！")
            .Children(m => m.UsrDepartmentList)
            .HtmlAttributes(new { id = "tree" })
                        //.ChildrenHtmlAttributes(new { @class = "subItem" })
            .ItemTemplate(
                @<text> <strong>
                    @Ajax.ActionLink(item.Name, "Index", "SystemUser", new { did = item.Id }, Gfw.Web.Common.ViewHelper.AjaxGet)
                </strong>
                @Html.ActionLink("修改", "Edit", new { id = item.Id }) |
                @Html.ActionLink("删除", "Delete", new { id = item.Id })
                @Html.ActionLink("添加部门", "Create", new { id = item.Id })
                </text>))
            }
        </div>
    </div>
    <div class="bottom">
    </div>
</div>
<div id="@Gfw.Web.Common.ViewHelper.AjaxContainer" style="float:left; margin-left:10px; width:680px">
    @{ Html.RenderAction("Index", "SystemUser"); }
</div>
